Clarify find_route Documentation#4421
Clarify find_route Documentation#4421StephenChi-hi wants to merge 1 commit intolightningdevkit:mainfrom
Conversation
|
I've assigned @tankyleo as a reviewer! |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4421 +/- ##
==========================================
- Coverage 86.09% 86.06% -0.03%
==========================================
Files 156 156
Lines 103623 103623
Branches 103623 103623
==========================================
- Hits 89211 89187 -24
- Misses 11895 11919 +24
Partials 2517 2517
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| /// However, the enabled/disabled bit on such channels as well as the `htlc_minimum_msat` / | ||
| /// `htlc_maximum_msat` *are* checked as they may change based on the receiving node. | ||
| /// | ||
| /// Routes are constructed by searching the provided [`NetworkGraph`] for paths from the payer |
There was a problem hiding this comment.
This reads as a second introductory sentence, maybe it should simply replace the first sentence instead?
| /// | ||
| /// Routes are constructed by searching the provided [`NetworkGraph`] for paths from the payer | ||
| /// to the payee that satisfy the constraints in [`RouteParameters`]. Fees are accumulated | ||
| /// backwards from the payee to the payer, and CLTV expiry deltas are aggregated hop-by-hop. |
There was a problem hiding this comment.
"accumulated backwards" doesn't really tell me what this means or why its important if I don't know LN super well. Maybe its worth just leaving out or tweaking, though I'm not quite sure how to do so, maybe something like this?
| /// backwards from the payee to the payer, and CLTV expiry deltas are aggregated hop-by-hop. | |
| /// by totaling fees at each hop from the payee to the payer, and CLTV expiry deltas are aggregated hop-by-hop. |
| /// backwards from the payee to the payer, and CLTV expiry deltas are aggregated hop-by-hop. | ||
| /// | ||
| /// Channel selection and path ranking are influenced by the provided [`ScoreLookUp`] | ||
| /// implementation, which may apply penalties based on historical reliability, |
There was a problem hiding this comment.
Mention how the penalties are included.
|
🔔 1st Reminder Hey @tankyleo! This PR has been waiting for your review. |
hi, in this pr i worked on improving the documentation for the
find_routefunction insiderouter.rs.i explained better how the route is built using the
NetworkGraphandRouteParameters, and how fees are added up along the path. i also described how the cltv expiry is combined through the hops, and howScoreLookUpcan affect which path is chosen.i added more detail about how
first_hopsis used to pick outbound channels, and also listed the possible errors the function can return.i just wanted to make it easier for anyone reading the code to understand how route finding actually works and what to expect when calling this function.
this is part of my first open source contributions, so if anything should be adjusted or written better please let me know. i really appreciate the effort that has gone into this project already.